package com.itheima.d6_object_stream;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

/*
  目标：掌握对象字节输入流的使用：反序列化对象。
 */
public class Test2ObjectInputStream {


    public static void main(String[] args) throws IOException, ClassNotFoundException {


        ObjectInputStream ois=new ObjectInputStream(new FileInputStream("test.txt"));
        //读取对象
        Object stu=(Student) ois.readObject();
        System.out.println(stu.toString());
        ois.close();


    }
}
